package com.prs.crm.service.sms.impl;

import java.util.Collection;
import java.util.Date;

import com.prs.crm.context.Constrains;
import com.prs.crm.dao.sms.SmsTimerDao;
import com.prs.crm.domain.sms.SmsTimer;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.sms.SmsTimerService;

public class SmsTimerServiceImpl extends BaseServiceImpl<SmsTimer,SmsTimerDao> implements SmsTimerService{

	@Override
	public void saveSmsTimer(String[] phones, String message, Date sendTime) {
		// TODO Auto-generated method stub
		for(String phone : phones) {
			SmsTimer timer = new SmsTimer();
			timer.setMessage(message);
			timer.setTelephoneNo(phone);
			timer.setSendTime(sendTime);
			timer.setState(Constrains.SMS_TIMER_PRE);
			
			this.getDao().save(timer);
		}
	}

	@Override
	public Collection<SmsTimer> getCurrentSendMsg() {
		// TODO Auto-generated method stub
		return this.getDao().getCurrentSendMsg();
	}

}
